package com.buptlogistics.creditinvestigation.fragment;

import android.annotation.TargetApi;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.buptlogistics.creditinvestigation.R;
import com.buptlogistics.creditinvestigation.activity.MainActivity;
import com.buptlogistics.creditinvestigation.app.BaseFragment;

/**
 * 应收账款成功详情
 */
public class DeserveSuccessDetailFragment extends BaseFragment {
    private View view;

    private Button btn_close;

    public DeserveSuccessDetailFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        view = inflater.inflate(R.layout.fragment_deserve_success_detail, container, false);
        initViews();
        initEvents();
        return view;
    }

    protected void initViews() {
        btn_close = (Button) findViewById(R.id.btn_success_detail_close);
    }

    protected void initEvents() {
        btn_close.setOnClickListener(new View.OnClickListener() {
            @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(DeserveSuccessDetailFragment.this.getActivity(), MainActivity.class);
                // 启动intent对应的Activity
                startActivity(intent);
                DeserveSuccessDetailFragment.this.getActivity().finishAffinity();
            }
        });

    }

    protected View findViewById(int id) {
        return view.findViewById(id);
    }
}
